
package com.bigcat.gulimall.common.exception;

/**
 * 自定义异常
 *
 * @author sufer
 */
public class RRException extends RuntimeException {
	private static final long serialVersionUID = -2189886792306153494L;

	
    private String msg;
    private Integer code;

	public RRException() {
		super("服务器异常");
		this.code = 500;
		this.msg = "服务器异常";
	}

    public RRException(String msg) {
		super(msg);
		this.code = 500;
		this.msg = msg;
	}
	
	public RRException(String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
	}
	
	public RRException(Integer code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}
	
	public RRException(Integer code, String msg, Throwable e) {
		super(msg, e);
		this.code = code;
		this.msg = msg;
	}

	public RRException(BaseException baseException) {
		super(baseException.toString());
		this.code = baseException.getCode();
		this.msg = baseException.getMessage();
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}


}
